<?php
class lib_sys_city extends lib_base{
	public $table_name = "qc_sys_city";
    public $pk = "id";

    public function getList($cond)
    {
        $all = $this->findAll(array($cond));
        return $all;
    }

    public function get_citys($pid){
        $result = $this->findAll(array("status=1 and parent_id={$pid}"),'sort asc');
		if($result){
            foreach($result as $val){
                $res[] = $val['name'];
            }
            return $res;
        }
        return false;
		
    }

    public function site_act($doids,$status)
    {
        $arrBase = array(
            'status'=>1,
            'is_site'=>$status
        );

        return $this->update(array("{$this->pk} IN ({$doids})"),$arrBase);
    }
}